/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.distillerybagger.distilleryexplorer;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.Action;
import org.openide.nodes.AbstractNode;
import org.openide.nodes.Children;

/**
 *
 * @author clayton
 */
public class DistilleryRootNode extends AbstractNode
{
    
    public DistilleryRootNode(Children kids)
    {
        super(kids);
        setDisplayName("Distilleries");
    }

    @Override
    public Action[] getActions(boolean context) {
        Action[] result = new Action[]{
            new RefreshAction()
        };
        return result;
    }

    private final class RefreshAction extends AbstractAction {

        public RefreshAction() {
            putValue(Action.NAME, "Refresh");
        }

        @Override
        public void actionPerformed(ActionEvent e) {
            DistilleryExplorerTopComponent.refreshNode();
        }
    }

}
